package com.shrcl.engineerprocess.domain.proxy;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.shrcl.engineerprocess.domain.proxy.NotificationAction;

public class NotificationManager implements IsSerializable {
  public static Boolean isActionValid(final NotificationAction action, final String state) {
    if(action==null||state==null) return false;
    switch(action){
    	case performNotify:{
    		return "created".equals(state)||"notified".equals(state);
    	}
    	case confirm:{
    		return "notified".equals(state);
    	}
    	default:
    		return false;
    }
    
  }
  
  public static Boolean isActionValid(final NotificationAction action, final Enum<?> state) {
    return isActionValid(action,state.name());
    
  }
}
